package utils

import (
	"errors"
	"strings"
)

type ModuleFunc struct {
	Module string
	Func   string
}

func GetModuleFunc(path string) (*ModuleFunc, error) {
	paths := strings.Split(path, ".")
	if len(paths) != 2 {
		return nil, errors.New("path格式不正确,正确格式[模块名称.函数名称]")
	}
	mf := &ModuleFunc{}
	mf.Module = paths[0]
	mf.Func = paths[1]
	return mf, nil
}
